from pydantic import BaseModel, Field
from typing import List, Optional
from app.schemas.storage import OssConfig

class EventLevelCount(BaseModel):
    normal: int
    urgent: int
    danger: int

class EventTypeCount(BaseModel):
    title: str
    num: int


class EventDefectList(BaseModel):
    title: str
    flight_record_name: str
    shoot_time: str
    event_target_text: str
    label_time: str
    event_num: int
    target_num: int
    level_text: str
    process_status: str
    simple_source_text: str
    source_text: str
    location: str
    coordinate: str
    remark: str
    defect_img_url: str


class PatrolReport(BaseModel):
    source_id: int
    source_type: str
    total_event_num: int
    start_time: str
    end_time: str
    event_level_count: EventLevelCount
    event_type_count: List[EventTypeCount]
    event_defect_list: List[EventDefectList]
    oss_config: OssConfig
    upload_callback_url: str
